
package com.dmzc.addon;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class TestMain {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        final int N = scanner.nextInt();
        final int M = scanner.nextInt();
        if (N >= M) {
            System.out.println("NA");
            return;
        }

        long left = 0;
        long right = 0;
        Tutle tutle = null;
        List<Tutle> tutles = new ArrayList<>();
        int[][] arr = new int[M][3];
        int count = 0;
//        1*(n-1)*(n-2)
//        2*(n-2)(n-3)
//        3*(n-3)(n-4)
//        ......
//        (n-2)*2*1



        for (int i = N; i <= M; i++) {
            for (int j = i; j <= M; j++) {
                for (int k = j + 1; k <= M; k++) {
                    left = i * i + j * j;
                    right = k * k;
                    if (left == right) {
                        if (Utils.isCoprime(i, j)
                                && Utils.isCoprime(j, k)
                                && Utils.isCoprime(i, k)) {
                            tutle = new Tutle(i, j, k);
                            tutles.add(tutle);
                            tutle = null;
                        }
                    }
                }
            }
        }
        Object[] objects = tutles.toArray();
        Arrays.sort(objects);
        for (Object ob : objects) {
            System.out.println((Tutle) ob);
        }
    }
}


